import java.util.Arrays;

public class TwoNumSum {

    public static int[] find(int[] arr, int target) {
        int[] sum = new int[2];
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1; j++) {
                if (arr[i] + arr[j] == target) {
                    sum[0] = i;
                    sum[1] = j;
                }
            }
        }
        return sum;
    }

    public static void main(String[] args) {
        int[] nums = {2, 7, 11, 15};
        int target = 9;
        int[] arr = find(nums, target);
        System.out.println(Arrays.toString(arr));
    }
}
